#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main()
{
	vector<string> strdata;
	vector<char> cdata;
	vector<string> strput;
	while (true)
	{		
		string str;
		cin>>str;
		strdata.push_back(str);
		if (str == "0")
		{
			break;
		}
		char exchange;
		cin>>exchange;
		cdata.push_back(exchange);
	}
	
	int length = strdata.size();

	for (int i=0; i<length; i++)
	{
		int ilen = strdata[i].size();
		string outstr;
		for (int j=0; j<ilen; j++)
		{
			if (cdata[i] != strdata[i][j])
			{
				outstr.push_back(strdata[i][j]);
			}
		}
	
		cout<<outstr<<endl;
	}
	return 1;

}
